<template>
  <div class="centreLeft1">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span>
          <i class="iconfont icon-monitoring" />
        </span>
        <div class="d-flex">
          <span class="fs-xxl text mx-2">学生考勤</span>
          <dv-decoration-6 class="dv-dec-3" :color="datavColors"/>
          <el-tooltip
            class="box-item"
            effect="dark"
            content="放大"
            placement="top-start"
          >
            <img class="enlargeIcon" :src="enlargeIcon" alt="" @click="enlarge" />
          </el-tooltip>
        </div>
      </div>
      <div class="d-flex jc-center">
        <chart />
      </div>
    </div>
  </div>
  <el-dialog v-model="dialogVisible" title="学生考勤" width="1000px" draggable>
    <chart-large></chart-large>
  </el-dialog>
</template>

<script lang="ts">
import { defineComponent,computed,ref } from 'vue'
import { useStore } from 'vuex'
import Chart from "./chart/index"
import ChartLarge from "./chart/enlarge"
export default defineComponent({
  components: {
    Chart,
    ChartLarge
  },
  setup(){
    const dialogVisible = ref(false)
    const datavColors = computed(() => useStore().state.datavColors)
    const enlargeIcon = require("@/assets/enlarge.png")
    const enlarge = () =>{
      dialogVisible.value = true
    }
    return{
      dialogVisible,
      datavColors,
      enlargeIcon,
      enlarge
    }
  }
})
</script>

<style lang="scss" scoped>
$box-width: 100%;
$box-height: 350px;

.centreLeft1 {
  padding: 5px;
  height: $box-height;
  width: $box-width;
  border-radius: 5px;
  position: relative;
  .bg-color-black {
    padding: 5px;
    height: $box-height;
    width: $box-width;
    border-radius: 10px;
  }
  .text {
    color: #c3cbde;
  }
  .dv-dec-3 {
    position: relative;
    width: 100px;
    height: 20px;
    top: -3px;
  }
}
.enlargeIcon{
  width:16px;
  height:16px;
  position: absolute;
  right: 20px;
  cursor: pointer;
}
</style>
